package com.easylinkin.linkappapi.machinery.controller;


import com.easylinkin.linkappapi.machinery.entity.TowerCranePositionImage;
import com.easylinkin.linkappapi.machinery.service.TowerCranePositionImageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import site.morn.rest.RestBuilders;
import site.morn.rest.RestMessage;

/**
 * <p>
 * 塔吊位置打点配置 前端控制器
 * </p>
 *
 * @author Xiaoyang
 * @since 2022-11-21
 */
@RestController
@RequestMapping("/machinery/towerCranePositionImage")
@Api(tags = "塔吊位置打点配置管理")
public class TowerCranePositionImageController {

  @Autowired
  private TowerCranePositionImageService towerCranePositionImageService;

  @PostMapping("saveImage")
  @ApiOperation("上传图片")
  public RestMessage saveImage(@RequestBody TowerCranePositionImage image) {
    towerCranePositionImageService.saveImage(image);
    return RestBuilders.successBuilder().data(image).build();

  }

  @PostMapping("getImage")
  @ApiOperation("获取图片")
  public RestMessage getImage() {
    TowerCranePositionImage image = towerCranePositionImageService.getImage();
    return RestBuilders.successBuilder().data(image).build();
  }
}
